<?php
my_component_load('testing' , false);
my_component_load('paging' , false);  
my_component_load('data_setting', false);	
my_component_load('kelompok_pengantian' );
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$modulname = "Admin _BN_ Konfigurasi Data _BN_ Biaya Kesehatan";
if($_SERVER['REQUEST_METHOD'] == "POST" ):
   
    $validatepost = form_kelompok_pengantian_validate($id);
	switch($task){
		case   "pengantiancreate" :
		if($validatepost)
		{
			$errors = message_multi_error($validatepost);
			$content = $errors;
			$content .= form_kelompok_pengantian_create($id);
			generate_my_web($content,"","plain.php");
			exit; 
		}else {
				form_kelompok_pengantian_submit($id);
				$content =  "Updated";
				generate_my_web($content,"","plain.php");
				exit;
			 }
		break; 
	}
   

else: 	
	if($task == "editkelompok_pengantian"){
		$title= ($id > '0' ) ?  "Perubahan data" : "Tambah data";
		facebox_page('index.php?com=kelompok_pengantian&task=pengantiancreate&id='.$id , $title , 210	); 
	}elseif($task == "pengantiancreate"){ 
		$content  = form_kelompok_pengantian_create($id);
		generate_my_web($content,"","plain.php");
		exit; 
	}elseif($task == 'delete'){ // DELETE ITEM	
		remove_kelompok_pengantian($id);
		my_direct('index.php?com=kelompok_pengantian');
	}else{
		$pagename = "Daftar Biaya Kesehatan";
		load_facebox_script();
		$view =  list_kelompok_pengantian(); 
		
	}
endif;  
$content = spliter_browser( $view , $pagename ,'index.php?com=kelompok_pengantian&task=editkelompok_pengantian');
generate_my_web($content, $modulname);
?>